﻿@if (Request.IsAuthenticated) {
    <li>@Html.ActionLink(string.Format("Личный кабинет {0}",User.Identity.Name),"Manage","Account")
        <ul>
            <li>
                @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) {
                        @Html.AntiForgeryToken()
                        <a href="javascript:document.getElementById('logoutForm').submit()">Выйти</a>
                    }
            </li>
        </ul>
    </li>    
} else
{
    <li><span id="loginButton">Вход</span></li>
    <script>
        $(document).ready(function () {
            $('#loginButton').bind('click', function () { $('#loginWindow').jqxWindow('open'); });
            $('#loginWindow').jqxWindow({theme: theme, width: 150,height: 150, resizable: false, isModal: true, autoOpen: false});
            $('#loginWindowContent').load('/Account/Login?returnUrl=modal');
        });
    </script>   
    <div id="loginWindow">
        <div id="loginWindowHeader">
            Вход в систему
        </div>
        <div id="loginWindowContent" style="overflow: hidden">
        </div>
    </div>
}
